#ifndef SENDERDIALOG_H
#define SENDERDIALOG_H

#include <QDialog>
#include <QUdpSocket>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class SenderDialog; }
QT_END_NAMESPACE

class SenderDialog : public QDialog
{
    Q_OBJECT

public:
    SenderDialog(QWidget *parent = nullptr);
    ~SenderDialog();

private slots:
    //开始广播对应的槽函数
    void on_pushButton_clicked();
    //定时发送广播消息
    void sendMessage ();

private:
    Ui::SenderDialog *ui;
    QUdpSocket *udpsocket; //UDP套接字
    QTimer *timer; //定时器
    bool isStart; //标记开始或者停止广播的状态
};
#endif // SENDERDIALOG_H
